﻿<%@ Page Language="C#" MasterPageFile="~/Employeer/SearchMaster.master" AutoEventWireup="true" CodeFile="~/Employeer/SearchCV.aspx.cs" Inherits="Employeer_SearchCV" Title="npljobs.com || Search CV" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        
        /*css for  dropdown rounded corner */
        .selectRound {
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
        }    

        input {
            width: 120px;
        }

        .ui-widget {
            font-size: 11px;
            width: 160px;
        }
        /*css for styling dropdown */
        .ui-autocomplete {
            max-height: 100px;
            overflow-y: auto;
            /* prevent horizontal scrollbar */
            overflow-x: hidden;
            /* add padding to account for vertical scrollbar */
            /*padding-right: 10px;*/
            position: absolute;
            cursor: default;
            z-index: 9999 !important;
        }
        /* IE 6 doesn't support max-height
        * we use height instead, but this forces the menu to always be this tall
        */
        * html .ui-autocomplete {
            height: 100px;
        }

        .input-disabled {
            background-color: #EBEBE4;
            border: 1px solid #ABADB3;
            padding: 2px 1px;
        }

        /*css for  pager of grid */
        .Pager {
            width: 49%;
            margin-left: 359px;
            padding: 5px;
        }

        .Pager span {
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.42857143;
            color: #428bca;
            text-decoration: none;
            background-color: #eee;
            border: 1px solid #ddd;
        }

        .Pager a {
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.42857143;
            color: #428bca;
            text-decoration: none;
            background-color: #fff;
            border: 1px solid #ddd;
        }

        .Pager a:hover {
            background-color: #eee;
        }

       /*css for  dropdown items loader */
        .ui-autocomplete-loading {
            background: white url("/Employeer/SearchCvScripts/images/ajax-loader.gif") right center no-repeat;
        }

        /*css for body disable background and loader image show*/
        /* When the body has the loading class, we turn
               the scrollbar off with overflow:hidden */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            top: 10%;
            left: 2px;
            height: 80%;
            width: 80%;
            background: rgba( 255, 255, 255, .5 ) url('/Employeer/SearchCvScripts/images/loader.gif') 50% 50% no-repeat;
        }

        body.loading {
            overflow: hidden;
        }

            /* Anytime the body has the loading class, our
               modal element will be visible */
        body.loading .modal {
            display: block;
        }
        
        div.jquery-ajax-loader {
            background: #333 url(../img/loader.gif) no-repeat 50% 20%;
            opacity: .6;
            z-index: 99999;
        }
        /*css for body disable background and loader image show*
    </style>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/jquery.ajaxLoader.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/GridDataUtitlis.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/jobtitleAutoComplete.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/cityAutoComplete.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/categoryAutoComplete.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/skillsAutoComplete.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/employmentTypeDropDown.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/qualificationAutoComplete.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/ASPSnippets_Pager.min.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/searchAll.js" ) %>" type="text/javascript"></script>    
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/cvExperienceDropdown.js" ) %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Employeer/SearchCvScripts/spin.js" ) %>" type="text/javascript"></script>
    <script type="text/javascript">
        //<![CDATA[       

       

        function getUrlParams() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
           
        function GetGridData(pageIndex) {
            window.scrollTo(0, 0);
            $("body").ajaxLoader();

            var pageSize = $('#ctl00_MainContent_ddlPageSize option:selected').val().trim();

            var selectedUpdateTime = $('#ctl00_SearchContainer_ddlCvUpdate option:selected').text().trim();
            var selectedExperience = $('#ctl00_SearchContainer_DropDownListExperience option:selected').text().trim();

            var jobTitleText = "";
            $("#JobTitleSearch :text").each(function () {
                jobTitleText += $(this).val() + "$";
            });

            var jobSeekerPlaceText = "";
            $("#Place :text").each(function () {
                jobSeekerPlaceText += $(this).val() + "$";
            });

            var jobCategoryText = "";
            $("#Category :text").each(function () {
                jobCategoryText += $(this).val() + "$";
            });


            var jobSeekerEmploymentType = "";
            $("#EmploymentType :text").each(function () {
                jobSeekerEmploymentType += $(this).val() + "$";
            });


            var jobSeekerQualification = "";
            $("#Qualification :text").each(function () {
                jobSeekerQualification += $(this).val() + "$";
            });

            var jobSeekerSkills = "";
            $("#Skills :text").each(function () {
                jobSeekerSkills += $(this).val() + "$";
            });


            var category = getUrlParams()["id"];
            var categoryText;
            $.ajax({
                type: "POST",
                url: "HandlerSearchCV.ashx",
                data: { 'search': 'categoryById', 'Id': category },
                dataType: "json",
                success: function (data) {
                    if (jobCategoryText.length > 1)
                        categoryText = jobCategoryText;
                    else
                        categoryText = data.toString();
                    var pageSize = $('#ctl00_MainContent_ddlPageSize option:selected').val();
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        url: "SearchCV.aspx/getData",
                        data: JSON.stringify({ 'pageSize': pageSize, 'pageIndex': pageIndex, 'categoryText': categoryText, 'updateTime': selectedUpdateTime, 'experience': selectedExperience, 'jobTitle': jobTitleText, 'location': jobSeekerPlaceText, 'employmentType': jobSeekerEmploymentType, 'qualification': jobSeekerQualification, 'skills': jobSeekerSkills }),
                        datatype: "json",
                        success: function (data) {
                            //alert('PrintGrid2');

                            PrintGrid(data, pageIndex);
                            $("body").ajaxLoaderRemove().delay(3000);
                        },
                        error: function (xhr, tStatus, err) {
                            $("body").ajaxLoaderRemove().delay(3000);
                            if (xhr.status == "401") {
                                alert(xhr.status + " User Authorisation failed.Please login again.");
                                location.reload();
                            }
                        },
                        complete: function (xhr, status) {

                        }
                    })
                },

                error: function (response) {
                    alert(response.toString());
                }
            })


        }

        jQuery(document).ready(function () {
            $("form input:text").keypress(function (e) {
                if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
                    $(this).parent().parent().parent().parent().find('.ui-dialog-buttonpane').find('button:first').click(); /* Assuming the first one is the action button */
                    return false;
                }
            });

            $("#txtExperience").keyup(function (e) {

                $('#txtExperience').val($('#txtExperience').val().replace(/[a-z]/g, ""));

            });

            var id = getUrlParams()["id"];
            var cacheData = new Array();

            $('#CategoryReadOnlyText').attr('readonly', true);
            $('#CategoryReadOnlyText').addClass('input-disabled');

            //// here get all the values of text present

            LoadJobTitleAutoComplete();

            LoadCityAutoComplete();

            LoadCategoryAutoComplete(id);

            LoadSkillsAutoComplete();

            //  LoadEmploymentTypeAutoComplete();

            LoadEmploymentTypeDropDown();

            LoadQualificationAutoComplete();

            GetGridData(1);   // parameter page start index              
            $(".Pager .page").live("click", function () {
                GetGridData(parseInt($(this).attr('page')));
            });

        });

        //]]>               

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">

    <div id="GridData" class="row top-margin" style="width: 978px; margin: auto auto;">

        <!--Bottom Pagination Start-->
        <div class="row top-pagination">
            <div class="col-md-9">
                <a href="CategoryList.aspx" style="float: left;">
                    <img src="../img/left-arrow-big.png" height="11" width="25">
                    Back To CV’s Bank</a>
                <div id="NoRecordsMessage" style="color: red; display: none; float: left;">
                    <div style="margin-left: 10px">
                        No records found by your search....showing old results.                        
                    </div>
                </div>

            </div>

            <div id="PageRecords" class="col-md-3">
            </div>
        </div>
        <!--Bottom Pagination End-->

        <!-- Panel Container Start Here-->
        <div class="rightcontainer panel panel-default">
            <!-- Panel Header Here-->
            <div class="panel-heading orange-gradiant">
                <h3 class="panel-title text-center">Resume result</h3>
            </div>
            <!-- Panel Header Here-->

            <!-- Panel Body Start Here-->
            <div id="datarows" class="panel-body">

                <div id="datarowsGrid" class="row search-cv">
                    <div class="row">
                        <h3>
                            <asp:Label ID="Label1" Text='<%#Eval("FirstName") %>' runat="server" />
                            <asp:Label ID="Label2" Text='<%#Eval("LastName") %>' runat="server" />
                        </h3>
                        <div class="col-md-6">
                            <p>
                                <asp:Label ID="Label3" Text='<%#Eval("Degree") %>' runat="server" />
                                ,
                                    <asp:Label ID="Label4" Text='<%#Eval("InstitutionName") %>' runat="server" />
                                <br>
                                <asp:Label ID="Label5" Text='<%#Eval("Title") %>' runat="server" /><br>
                                <asp:Label ID="Label6" Text='<%#Eval("CompanyName") %>' runat="server" />
                            </p>
                        </div>
                        <div class="col-md-6 pull-right">
                            <div class="col-md-4">
                                <span>CV Update</span>
                                <br>
                                <span>Experiences</span><br>
                                <span>Desired Salary</span>
                            </div>
                            <div class="col-md-8">
                                :
                                <asp:Label ID="Label7" Text='<%#Eval("cvLastUpdated") %>' runat="server" /><br>
                                :
                                <asp:Label ID="Label8" Text='<%#Eval("totalExperience") %>' runat="server" /><br>
                                :
                                <asp:Label ID="Label19" Text='<%#Eval("ExpectedSalaryRange") %>' runat="server" />GBP/YR
                            </div>
                        </div>
                    </div>
                    <div class="clearfix">&nbsp;</div>
                    <div class="row skill-in-cv">
                        <div class="col-md-4">
                            <span>Top Skill</span><br>
                            <asp:Label ID="Label9" Text='<%#Eval("SkillOne") %>' runat="server" /><br />
                            <asp:Label ID="Label10" Text='<%#Eval("SkillTwo") %>' runat="server" /><br />
                            <asp:Label ID="Label11" Text='<%#Eval("SkillThree") %>' runat="server" /><br />
                            <asp:Label ID="Label12" Text='<%#Eval("SkillFour") %>' runat="server" />
                        </div>
                        <div class="col-md-4">
                            <span>Company</span><br>
                            <asp:Label ID="Label13" Text='<%#Eval("company1") %>' runat="server" /><br />
                            <asp:Label ID="Label14" Text='<%#Eval("company2") %>' runat="server" /><br />
                            <asp:Label ID="Label15" Text='<%#Eval("company3") %>' runat="server" />
                        </div>
                        <div class="col-md-4">
                            <span>Experience</span><br>
                            <asp:Label ID="Label16" Text='<%#Eval("companyExp1") %>' runat="server" /><br>
                            <asp:Label ID="Label17" Text='<%#Eval("companyExp2") %>' runat="server" /><br>
                            <asp:Label ID="Label18" Text='<%#Eval("companyExp3") %>' runat="server" />
                        </div>
                    </div>
                    <div class="row pull-right search-cs-details-btn">
                        <button type="button" class="btn btn-primary orange-gradiant float-shadow">Details</button>
                    </div>
                </div>

                <div class="Pager">
                </div>
                <div style="margin-left: 100px;">
                    <asp:DropDownList ID="ddlPageSize" CssClass="selectRound" Style="margin-left: 200px;" runat="server" OnChange="GetChangeByDropDownExpCVUpdate('');return false;">
                        <asp:ListItem Value="5" Text="Page Size 5">  </asp:ListItem>
                        <asp:ListItem Value="15" Text="Page Size 15"> </asp:ListItem>
                        <asp:ListItem Value="25" Text="Page Size 25">  </asp:ListItem>
                        <asp:ListItem Value="30" Text="Page Size 30">  </asp:ListItem>
                        <asp:ListItem Value="35" Text="Page Size 35">  </asp:ListItem>
                    </asp:DropDownList>
                </div>
                <br />
            </div>
        </div>

    </div>

    <div style="clear: both;">&nbsp;</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="SearchContainer" runat="server">
    <div style="clear: both;"></div>
    <div class="edit-profile-float-nav ">
        <div class="left-panel-header">
            Refine Search Result
        </div>

        <div id="Category" class="row">
            <div class="col-md-10">
                <h5>Category</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <input id="CategoryReadOnlyText" autocomplete="off" type="text" placeholder="Enter Category" class="form-control">
            </div>
            <div id="divCategoryAdd" class="col-md-12 add-another-input"><a id="CategoryAdd" href="#">[+] Add Another Category</a></div>
        </div>
        <div id="JobTitleSearch" class="row">
            <div class="col-md-10">
                <h5>Job title</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <input id="TitleText0" autocomplete="off" type="text" placeholder="Enter JobTitle" class="form-control">
            </div>
            <div id="divTitleAdd" class="col-md-12 add-another-input"><a id="TitleAdd" href="#">[+] Add Another Jobtitle</a></div>
        </div>

        <div id="Place" class="row">
            <div class="col-md-10">
                <h5>City/Country</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <input id="PlaceTxt" autocomplete="off" type="text" placeholder="Enter City/Country" class="form-control">
            </div>
            <div id="divPlaceAdd" class="col-md-12 add-another-input"><a id="PlaceAdd" href="#">[+] Add Another City/Country</a></div>
        </div>
        <div id="Skills" class="row">
            <div class="col-md-10">
                <h5>Skills/Keywords</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <input id="SkillsText" autocomplete="off" type="text" placeholder="Enter Skills/Keywords" class="form-control">
            </div>
            <div id="divSkillsAdd" class="col-md-12 add-another-input"><a id="SkillsAdd" href="#">[+] Add Another Skills/Keywords</a></div>
        </div>
        <div id="Qualification" class="row">
            <div class="col-md-10">
                <h5>Qualification</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <input id="QualificationText" autocomplete="off" type="text" placeholder="Enter Qualification" class="form-control">
            </div>
            <div id="divQualificationAdd" class="col-md-12 add-another-input"><a id="QualificationAdd" href="#">[+] Add Another Qualification</a></div>
        </div>
        <div id="YearsExperience" class="row">
            <div class="col-md-10">
                <h5>Years of experience</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <asp:DropDownList ID="DropDownListExperience" runat="server" CssClass="selectRound" Width="240px" OnChange="GetChangeByDropDownExpCVUpdate(ctl00_SearchContainer_DropDownListExperience);return false;">
                    <asp:ListItem>Any</asp:ListItem>
                    <asp:ListItem>1</asp:ListItem>
                    <asp:ListItem>2</asp:ListItem>
                    <asp:ListItem>3</asp:ListItem>
                    <asp:ListItem>4</asp:ListItem>
                    <asp:ListItem>5</asp:ListItem>
                    <asp:ListItem>6</asp:ListItem>
                    <asp:ListItem>7</asp:ListItem>
                    <asp:ListItem>8</asp:ListItem>
                    <asp:ListItem>9</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem><1</asp:ListItem>
                    <asp:ListItem><2</asp:ListItem>
                    <asp:ListItem><3</asp:ListItem>
                    <asp:ListItem><4</asp:ListItem>
                    <asp:ListItem><5</asp:ListItem>
                    <asp:ListItem><6</asp:ListItem>
                    <asp:ListItem><7</asp:ListItem>
                    <asp:ListItem><8</asp:ListItem>
                    <asp:ListItem><9</asp:ListItem>
                    <asp:ListItem><10</asp:ListItem>
                </asp:DropDownList>
            </div>
            <br />
        </div>
        <div id="EmploymentType" class="row">
            <div class="col-md-10">
                <h5>Employment type</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div id="empDropDown" class="col-md-12"></div>

        </div>
        <div id="CVUpdate" class="row">
            <div class="col-md-10">
                <h5>Last update</h5>
            </div>
            <div class="col-md-2">
                <h5>+</h5>
            </div>
            <div class="col-md-12">
                <asp:DropDownList ID="ddlCvUpdate" runat="server" CssClass="selectRound" Width="240px" OnChange="GetChangeByDropDownExpCVUpdate(ctl00_SearchContainer_ddlCvUpdate);return false;">
                    <asp:ListItem>Any Time</asp:ListItem>
                    <asp:ListItem>Last Week</asp:ListItem>
                    <asp:ListItem>Last Month</asp:ListItem>
                    <asp:ListItem>Last 6 Months</asp:ListItem>
                </asp:DropDownList>
            </div>
            <br />
        </div>
        <div class="row text-center">
            <button class="btn btn-primary orange-gradiant float-shadow" type="button" onclick="return SearchAll();return false;">Search</button>
        </div>
    </div>

    <div style="clear: both;">&nbsp;</div>
</asp:Content>


